<?php defined('SYSPATH') or die('No direct access allowed.');
/**
 * @file init.php
 * @brief 包含所有的业务逻辑层组件
 * @author Lionel Tsai
 * @version 1.0
 * @date 2012-02-20
 */
Kohana::modules( array_merge(
	Kohana::modules(),
	array(
		'ed-auth' => MODPATH.'ed-auth',			//application authority
		'userguide'  => MODPATH.'userguide',  // User guide and API documentation
		'orm'        => MODPATH.'orm',        // Object Relationship Mapping
		'auth'       => MODPATH.'auth',       // Basic authentication
		'cache'      => MODPATH.'cache',      // Caching with multiple backends
		// 'codebench'  => MODPATH.'codebench',  // Benchmarking tool
		'database'   => MODPATH.'database',   // Database access
		// 'image'      => MODPATH.'image',      // Image manipulation

	)
   ));

/**
 * @brief 定义EDAPI,如果 ed-api_app使用则EDAPI = '',否则，EDAPI = 'ed-api/'
 *
 * @param 
 * @param 'ed-api'
 */
defined('EDAPI') or define('EDAPI', 'ed-api/');

//登入退出路由
Route::set('edpassport', EDAPI . '<action>', array('action' => 'login|logout'))
 ->defaults(array(
		'controller'	=> 'userpass',
		'action'		=> 'login'    
	   ));
//EDAPI 路由
Route::set('edapi', EDAPI . '(<controller>)(/<id>)(/<action>)(/<id2>)', array('action' => '\D[^\/]*', 'id' => '\d+', 'id2' => '(\d+,?)+'))
->defaults(array(
	'controller'	=> 'welcome',
	'action'		=> 'index',
));


